
#include "frame.h"


uint64_t flowID(const struct sniff_ip* ip, const struct sniff_tcp *tcp)
{
	if(ip->ip_src.s_addr > ip->ip_dst.s_addr)
		return ((((uint64_t)ip->ip_src.s_addr)<<32) | (uint64_t)ip->ip_dst.s_addr) + (((uint64_t)ntohs(tcp->th_dport)<<24) + (uint64_t)ntohs(tcp->th_sport));
	else
		return ((((uint64_t)ip->ip_dst.s_addr)<<32) | (uint64_t)ip->ip_src.s_addr) + (((uint64_t)ntohs(tcp->th_sport)<<24) + (uint64_t)ntohs(tcp->th_dport));
}

